import 'package:flutter/material.dart';

import 'curvepainter.dart';
import 'ecgcontroller.dart';

class EcgWaveChart extends StatelessWidget {
  EcgWaveChart(
      {Key? key,
      required this.waveContext,
      required this.points,
      required this.paused})
      : super(key: key);
  final WaveParameter waveContext;
  final List<int> points;
  bool paused;

  @override
  Widget build(BuildContext context) {
    // print('build');
    // print('length:${controller.waveI.length}');
    // var wave = controller.waveI;
    // print('${wave.length}');
    return ClipRect(
      clipBehavior: Clip.hardEdge,
      child: SizedBox(
        width: waveContext.winWidth,
        height: waveContext.winHeight,
        child: Container(
          // decoration: const BoxDecoration(color: Colors.black),
          // padding: EdgeInsets.symmetric(horizontal: 5),
          decoration: const BoxDecoration(
            color: Colors.black,
            border: Border(bottom: BorderSide(width: 1, color: Colors.white60)),
          ),
          child: CustomPaint(
            child: Container(),
            painter: CurvePainter(
                context: context,
                waveContext: waveContext,
                points: points,
                paused: paused),
          ),
        ),
      ),
    );
  }
}
